from selenium.webdriver.common.by import By

from Base.base_page import WebBasePage


# web登录界面
class WebLoginPage(WebBasePage):
    """
    web登录界面
    """
    def __init__(self):
        super().__init__()
        self.phone = (By.XPATH,'//*[@placeholder="请输入手机号"]')
        self.code = (By.XPATH,'//*[@placeholder="请输入验证码"]')
        self.login_button = (By.XPATH,'//*[@class="verify-login-button pl-btn pl-btn-primary pl-btn-medium pl-btn-radius"]')
    def web_login(self, pho, cod):
        self.input_text(self.find_element(self.phone),pho)
        self.input_text(self.find_element(self.code),cod)
        self.click_element(self.find_element(self.login_button))
        print("登录成功")